
/*
*备注：组织机构、部门表
*时间：2014年3月3日 14:39:11
*/

CREATE TABLE Base_Organization
(
	Organization_ID VARCHAR2(50) NOT NULL PRIMARY KEY,
	Organization_Code VARCHAR2(20),
	Organization_Name VARCHAR2(50),
	Organization_InnerPhone VARCHAR2(20),
	Organization_OuterPhone VARCHAR2(20),
	Organization_Manager VARCHAR2(50),
	Organization_AssistantManager VARCHAR2(50),
	Organization_Fax VARCHAR2(20),
	Organization_Zipcode VARCHAR2(20),
	Organization_Address VARCHAR2(200),
	ParentId VARCHAR2(50),
	Organization_Remark VARCHAR2(200),
	SortCode INT ,
	DeleteMark INT DEFAULT(1),
	CreateDate DATE DEFAULT(SYSDATE),
	CreateUserId VARCHAR2(50),
	CreateUserName VARCHAR2(50),
	ModifyDate DATE,
	ModifyUserId VARCHAR2(50),
	ModifyUserName VARCHAR2(50)
);

/*

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'部门主键' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_Organization', @level2type=N'COLUMN',@level2name=N'Organization_ID'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_Organization', @level2type=N'COLUMN',@level2name=N'Organization_Code'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'部门名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_Organization', @level2type=N'COLUMN',@level2name=N'Organization_Name'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'外线电话' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_Organization', @level2type=N'COLUMN',@level2name=N'Organization_InnerPhone'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'内线电话' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_Organization', @level2type=N'COLUMN',@level2name=N'Organization_OuterPhone'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'主负责人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_Organization', @level2type=N'COLUMN',@level2name=N'Organization_Manager'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'副负责人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_Organization', @level2type=N'COLUMN',@level2name=N'Organization_AssistantManager'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'传真' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_Organization', @level2type=N'COLUMN',@level2name=N'Organization_Fax'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'邮政区号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_Organization', @level2type=N'COLUMN',@level2name=N'Organization_Zipcode'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'地址' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_Organization', @level2type=N'COLUMN',@level2name=N'Organization_Address'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'父节点主键' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_Organization', @level2type=N'COLUMN',@level2name=N'ParentId'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注说明' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_Organization', @level2type=N'COLUMN',@level2name=N'Organization_Remark'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'排序吗' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_Organization', @level2type=N'COLUMN',@level2name=N'SortCode'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'删除标记' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_Organization', @level2type=N'COLUMN',@level2name=N'DeleteMark'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_Organization', @level2type=N'COLUMN',@level2name=N'CreateDate'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建用户主键' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_Organization', @level2type=N'COLUMN',@level2name=N'CreateUserId'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建用户' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_Organization', @level2type=N'COLUMN',@level2name=N'CreateUserName'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_Organization', @level2type=N'COLUMN',@level2name=N'ModifyDate'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改用户主键' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_Organization', @level2type=N'COLUMN',@level2name=N'ModifyUserId'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改用户' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_Organization', @level2type=N'COLUMN',@level2name=N'ModifyUserName'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'组织机构、部门表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_Organization'
GO

ALTER TABLE [dbo].[Base_Organization] ADD  CONSTRAINT [DF_Base_Organization_DeleteMark]  DEFAULT ((1)) FOR [DeleteMark]
GO

ALTER TABLE [dbo].[Base_Organization] ADD  CONSTRAINT [DF_Base_Organization_CreateDate]  DEFAULT (getdate()) FOR [CreateDate]
GO

*/